.class final Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;
.super Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/c;


# instance fields
.field private a:Z

.field private b:Ljava/lang/Class;


# direct methods
.method public constructor <init>(I)V
    .locals 1

    invoke-direct {p0}, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/c;-><init>()V

    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->a:Z

    invoke-virtual {p0, p1}, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->setSpace(I)V

    return-void
.end method

.method public constructor <init>(Ljava/lang/String;ILcom/wqmobile/sdk/pojoxml/core/PojoXmlInitInfo;)V
    .locals 1

    invoke-direct {p0, p1, p2, p3}, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/c;-><init>(Ljava/lang/String;ILcom/wqmobile/sdk/pojoxml/core/PojoXmlInitInfo;)V

    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->a:Z

    return-void
.end method


# virtual methods
.method public final process(Ljava/lang/Object;)Ljava/lang/String;
    .locals 9

    const/4 v8, 0x0

    const/4 v7, 0x1

    invoke-virtual {p0}, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->getElementName()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p0, p1, v0}, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->isEmptyElement(Ljava/lang/Object;Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_0

    invoke-virtual {p0}, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->getElementName()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p0}, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->getAttributes()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {p0}, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->getSpace()I

    move-result v2

    invoke-virtual {p0, v0, v1, v2}, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->createEmptyElementWithNL(Ljava/lang/String;Ljava/lang/String;I)Ljava/lang/String;

    move-result-object v0

    :goto_0
    return-object v0

    :cond_0
    invoke-static {p1}, Lcom/wqmobile/sdk/pojoxml/util/ClassUtil;->getIterator(Ljava/lang/Object;)Ljava/util/Iterator;

    move-result-object v0

    :cond_1
    :goto_1
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v1

    if-nez v1, :cond_2

    invoke-static {p1}, Lcom/wqmobile/sdk/pojoxml/util/ClassUtil;->getIterator(Ljava/lang/Object;)Ljava/util/Iterator;

    move-result-object v0

    check-cast p1, Ljava/util/Collection;

    invoke-interface {p1}, Ljava/util/Collection;->size()I

    move-result v1

    move v2, v8

    :goto_2
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v3

    if-nez v3, :cond_4

    invoke-virtual {p0}, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->getXmlContent()Ljava/lang/String;

    move-result-object v0

    goto :goto_0

    :cond_2
    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    if-eqz v1, :cond_1

    invoke-virtual {v1}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v2

    invoke-static {v2}, Lcom/wqmobile/sdk/pojoxml/util/ClassUtil;->isPrimitiveOrWrapper(Ljava/lang/Class;)Z

    move-result v2

    if-nez v2, :cond_1

    invoke-static {v1}, Lcom/wqmobile/sdk/pojoxml/util/ClassUtil;->isCollection(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_3

    new-instance v0, Lcom/wqmobile/sdk/pojoxml/core/PojoXmlException;

    const-string v1, "Inner Collection object is not supported."

    invoke-direct {v0, v1}, Lcom/wqmobile/sdk/pojoxml/core/PojoXmlException;-><init>(Ljava/lang/String;)V

    throw v0

    :cond_3
    invoke-virtual {v1}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v1

    iput-object v1, p0, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->b:Ljava/lang/Class;

    iput-boolean v7, p0, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->a:Z

    goto :goto_1

    :cond_4
    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v3

    if-nez v3, :cond_8

    invoke-virtual {p0}, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->getElementName()Ljava/lang/String;

    move-result-object v4

    if-nez v3, :cond_6

    iget-boolean v3, p0, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->a:Z

    if-eqz v3, :cond_7

    if-nez v2, :cond_5

    invoke-virtual {p0}, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->getElementName()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {p0}, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->getAttributes()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {p0}, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->getSpace()I

    move-result v5

    invoke-virtual {p0, v3, v4, v5}, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->getStartTag(Ljava/lang/String;Ljava/lang/String;I)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {p0, v3}, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->writeXmlContent(Ljava/lang/String;)V

    invoke-virtual {p0}, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->incrementSpace()V

    :cond_5
    iget-object v3, p0, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->b:Ljava/lang/Class;

    invoke-static {v3}, Lcom/wqmobile/sdk/pojoxml/util/ClassUtil;->getClassName(Ljava/lang/Class;)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {p0}, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->getAttributes()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {p0}, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->getSpace()I

    move-result v5

    invoke-virtual {p0, v3, v4, v5}, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->createEmptyElementWithNL(Ljava/lang/String;Ljava/lang/String;I)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {p0, v3}, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->writeXmlContent(Ljava/lang/String;)V

    sub-int v3, v1, v7

    if-ne v2, v3, :cond_6

    invoke-virtual {p0}, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->decrementSpace()V

    invoke-virtual {p0}, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->getElementName()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {p0}, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->getSpace()I

    move-result v4

    invoke-virtual {p0, v3, v4}, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->getCloseTagWithNL(Ljava/lang/String;I)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {p0, v3}, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->writeXmlContent(Ljava/lang/String;)V

    :cond_6
    :goto_3
    add-int/lit8 v2, v2, 0x1

    goto/16 :goto_2

    :cond_7
    invoke-virtual {p0}, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->getAttributes()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {p0}, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->getSpace()I

    move-result v5

    invoke-virtual {p0, v4, v3, v5}, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->createEmptyElementWithNL(Ljava/lang/String;Ljava/lang/String;I)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {p0, v3}, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->writeXmlContent(Ljava/lang/String;)V

    goto :goto_3

    :cond_8
    invoke-virtual {v3}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v4

    invoke-static {v4}, Lcom/wqmobile/sdk/pojoxml/util/ClassUtil;->isPrimitiveOrWrapper(Ljava/lang/Class;)Z

    move-result v4

    if-eqz v4, :cond_a

    invoke-virtual {p0}, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->getElementName()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {p0}, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->getAttributes()Ljava/lang/String;

    move-result-object v5

    invoke-virtual {p0}, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->getSpace()I

    move-result v6

    invoke-virtual {p0, v4, v5, v6}, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->getStartTag(Ljava/lang/String;Ljava/lang/String;I)Ljava/lang/String;

    move-result-object v4

    invoke-virtual {p0, v4}, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->writeXmlContent(Ljava/lang/String;)V

    invoke-virtual {p0}, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->isCdataEnabled()Z

    move-result v4

    invoke-static {v3, v4}, Lcom/wqmobile/sdk/pojoxml/util/StringUtil;->getActualValue(Ljava/lang/Object;Z)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {p0, v3}, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->writeXmlContent(Ljava/lang/String;)V

    invoke-virtual {p0}, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->getElementName()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {p0, v3, v8}, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->getCloseTagWithNL(Ljava/lang/String;I)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {p0, v3}, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->writeXmlContent(Ljava/lang/String;)V

    :cond_9
    :goto_4
    add-int/lit8 v2, v2, 0x1

    goto/16 :goto_2

    :cond_a
    invoke-static {v3}, Lcom/wqmobile/sdk/pojoxml/util/ClassUtil;->isCollection(Ljava/lang/Object;)Z

    move-result v4

    if-eqz v4, :cond_b

    new-instance v0, Lcom/wqmobile/sdk/pojoxml/core/PojoXmlException;

    const-string v1, "Inner Collection object is not supported."

    invoke-direct {v0, v1}, Lcom/wqmobile/sdk/pojoxml/core/PojoXmlException;-><init>(Ljava/lang/String;)V

    throw v0

    :cond_b
    if-nez v2, :cond_c

    invoke-virtual {p0}, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->getElementName()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {p0}, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->getAttributes()Ljava/lang/String;

    move-result-object v5

    invoke-virtual {p0}, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->getSpace()I

    move-result v6

    invoke-virtual {p0, v4, v5, v6}, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->getStartTag(Ljava/lang/String;Ljava/lang/String;I)Ljava/lang/String;

    move-result-object v4

    invoke-virtual {p0, v4}, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->writeXmlContent(Ljava/lang/String;)V

    invoke-virtual {p0}, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->incrementSpace()V

    :cond_c
    invoke-virtual {p0, v3}, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->processObject(Ljava/lang/Object;)V

    const-string v3, "\n"

    invoke-virtual {p0, v3}, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->writeXmlContent(Ljava/lang/String;)V

    sub-int v3, v1, v7

    if-ne v2, v3, :cond_9

    invoke-virtual {p0}, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->decrementSpace()V

    invoke-virtual {p0}, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->getElementName()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {p0}, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->getSpace()I

    move-result v4

    invoke-virtual {p0, v3, v4}, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->getCloseTagWithNL(Ljava/lang/String;I)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {p0, v3}, Lcom/wqmobile/sdk/pojoxml/core/processor/pojotoxml/b;->writeXmlContent(Ljava/lang/String;)V

    goto :goto_4
.end method
